package com.img.examine.mapper;

import com.img.examine.entity.EmployeeEntity;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;

@Mapper
@Repository
public interface EmployeeMapper {
    @Select("select * from sys_employee where KEY_ID!='' and KEY_ID like #{key_id} and `name` like #{name} ORDER BY ICON*1 DESC")
    ArrayList<EmployeeEntity> getEmployeeAll(@Param("key_id")String key_id, @Param("name")String name);
    @Select("select * from sys_employee where KEY_ID!='' and (ICON*1>#{time2}*1 and ICON*1<#{time1}*1) and KEY_ID like #{key_id} and `name` like #{name} ORDER BY ICON*1 DESC")
    ArrayList<EmployeeEntity> getEmployee(@Param("key_id")String key_id, @Param("name")String name, @Param("time1")String time1, @Param("time2")String time2);

    @Update("update sys_employee set ICON = 'defaulticon.png' where KEY_ID=#{KEY_ID}")
    int setEmployeeIcon(@Param("KEY_ID") String KEY_ID);
}
